class Solution:
    # @param haystack, a string
    # @param needle, a string
    # @return a string or None
    def strStr(self, haystack, needle):
        n = len(haystack)-len(needle)+1
        for i in range(n):
            k = 0
            for j in range(i,i+len(needle)):
                if needle[k] != haystack[j]:
                    break
                k += 1
            if k == len(needle):
                return haystack[slice(i,i+len(haystack))]
        return None

hay = "1234567"
need = ""
ss = Solution()
print ss.strStr(hay, need)
